package com.dragon.modules.yuegou.query.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.system.DailySeqEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDate;
/**
 * 序列(每日重置） 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-03-20 10:24:09
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class DailySeqQuery extends DailySeqEntity implements Query<DailySeqEntity>{


    /** 序列名称查询条件 */
	@JsonUnwrapped(prefix = "seqName")
	private Condition<String> seqNameCondition;

    /** 日期查询条件 */
	@JsonUnwrapped(prefix = "curDate")
	private Condition<LocalDate> curDateCondition;

    /** 值查询条件 */
	@JsonUnwrapped(prefix = "curValue")
	private Condition<Integer> curValueCondition;

    /** 增量查询条件 */
	@JsonUnwrapped(prefix = "increment")
	private Condition<Integer> incrementCondition;

    /** 备注查询条件 */
	@JsonUnwrapped(prefix = "remark")
	private Condition<String> remarkCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public DailySeqQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public DailySeqQuery(DailySeqEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public DailySeqQuery(DailySeqQuery other) {
		super(other);
		if(other.seqNameCondition != null) {
			this.seqNameCondition = other.seqNameCondition.copy();
		}
		if(other.curDateCondition != null) {
			this.curDateCondition = other.curDateCondition.copy();
		}
		if(other.curValueCondition != null) {
			this.curValueCondition = other.curValueCondition.copy();
		}
		if(other.incrementCondition != null) {
			this.incrementCondition = other.incrementCondition.copy();
		}
		if(other.remarkCondition != null) {
			this.remarkCondition = other.remarkCondition.copy();
		}
	}

	@Override
	public QueryWrapper<DailySeqEntity> toQueryWrapper() {
		QueryWrapper<DailySeqEntity> wrapper = new QueryWrapper<>(this);
		if (seqNameCondition != null) {
			seqNameCondition.toWrapper(wrapper, COL_SEQ_NAME);
		}
		if (curDateCondition != null) {
			curDateCondition.toWrapper(wrapper, COL_CUR_DATE);
		}
		if (curValueCondition != null) {
			curValueCondition.toWrapper(wrapper, COL_CUR_VALUE);
		}
		if (incrementCondition != null) {
			incrementCondition.toWrapper(wrapper, COL_INCREMENT);
		}
		if (remarkCondition != null) {
			remarkCondition.toWrapper(wrapper, COL_REMARK);
		}
		return wrapper;
	}

	/**
	 * 构造并返回序列名称查询条件
	 * 
	 * @return seqNameCondition 序列名称查询条件
	 */
	public Condition<String> seqName() {
		this.seqNameCondition = new Condition<>();
		return this.seqNameCondition;
	}
	
	/**
	 * 获取序列名称查询条件
	 * 
	 * @return seqNameCondition 序列名称查询条件
	 */
	public Condition<String> getSeqNameCondition() {
		return seqNameCondition;
	}

	/**
	 * 设置序列名称查询条件
	 * 
	 * @param seqNameCondition 序列名称查询条件
	 */
	public void setSeqNameCondition(Condition<String> seqNameCondition) {
		this.seqNameCondition = seqNameCondition;
	}

	/**
	 * 构造并返回日期查询条件
	 * 
	 * @return curDateCondition 日期查询条件
	 */
	public Condition<LocalDate> curDate() {
		this.curDateCondition = new Condition<>();
		return this.curDateCondition;
	}
	
	/**
	 * 获取日期查询条件
	 * 
	 * @return curDateCondition 日期查询条件
	 */
	public Condition<LocalDate> getCurDateCondition() {
		return curDateCondition;
	}

	/**
	 * 设置日期查询条件
	 * 
	 * @param curDateCondition 日期查询条件
	 */
	public void setCurDateCondition(Condition<LocalDate> curDateCondition) {
		this.curDateCondition = curDateCondition;
	}

	/**
	 * 构造并返回值查询条件
	 * 
	 * @return curValueCondition 值查询条件
	 */
	public Condition<Integer> curValue() {
		this.curValueCondition = new Condition<>();
		return this.curValueCondition;
	}
	
	/**
	 * 获取值查询条件
	 * 
	 * @return curValueCondition 值查询条件
	 */
	public Condition<Integer> getCurValueCondition() {
		return curValueCondition;
	}

	/**
	 * 设置值查询条件
	 * 
	 * @param curValueCondition 值查询条件
	 */
	public void setCurValueCondition(Condition<Integer> curValueCondition) {
		this.curValueCondition = curValueCondition;
	}

	/**
	 * 构造并返回增量查询条件
	 * 
	 * @return incrementCondition 增量查询条件
	 */
	public Condition<Integer> increment() {
		this.incrementCondition = new Condition<>();
		return this.incrementCondition;
	}
	
	/**
	 * 获取增量查询条件
	 * 
	 * @return incrementCondition 增量查询条件
	 */
	public Condition<Integer> getIncrementCondition() {
		return incrementCondition;
	}

	/**
	 * 设置增量查询条件
	 * 
	 * @param incrementCondition 增量查询条件
	 */
	public void setIncrementCondition(Condition<Integer> incrementCondition) {
		this.incrementCondition = incrementCondition;
	}

	/**
	 * 构造并返回备注查询条件
	 * 
	 * @return remarkCondition 备注查询条件
	 */
	public Condition<String> remark() {
		this.remarkCondition = new Condition<>();
		return this.remarkCondition;
	}
	
	/**
	 * 获取备注查询条件
	 * 
	 * @return remarkCondition 备注查询条件
	 */
	public Condition<String> getRemarkCondition() {
		return remarkCondition;
	}

	/**
	 * 设置备注查询条件
	 * 
	 * @param remarkCondition 备注查询条件
	 */
	public void setRemarkCondition(Condition<String> remarkCondition) {
		this.remarkCondition = remarkCondition;
	}

}
